10. Coding Challenge

KOTLIN PART2 L4 A10 Challenge- Customize Your Hunt

In this lesson you only have three geofences in the app, but the maximum is 100! You can add landmarks to customize your hunt and add more to make the treasure hunt last longer. You have everything you need to add another geofence to make your treasure hunt longer!

  1. In strings.xml add in your custom hint and location.
<!-- Geofence Hints -->
<string name="lombard_street_hint">Go to the most crooked street in the City</string>
<!-- Geofence Locations -->
<string name="lombard_street_location">at Lombard Street</string>
  1. In GeofenceUtils.kt, you can customize the landmarks by creating a LandmarkDataObject with a destination ID, destination hint, destination location, and destination latitude and longitude. Add this to the LANDMARK_DATA array with your own landmark objects.
val LANDMARK_DATA = arrayOf(
   LandmarkDataObject(
       “Lombard street”,
       R.string.lombard_street_hint,
       R.string.lombard_street_location,
       LatLng(37.801205, -122.426752))
)